<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
    <div class="table-responsive">
        <div class="ml10 mr10 pt10 pb10">
                <div th:if="${#maps.isEmpty(dataMap)} or ${#lists.isEmpty(dataMap['list'])}">
                    <div class="text-center">
                        <div class="noDataTipsBox">
                            <p><span class="c-4e fs16">亲，还没有课程数据~~~</span></p>
                        </div>
                    </div>
            </div>
            <div class="row" th:if="!${#maps.isEmpty(dataMap)} and !${#lists.isEmpty(dataMap['list'])}">
                <div class="course-box col-sm-3 col-md-3 col-lg-2" th:each="course : ${dataMap['list']}" th:attr="id='course-data-'+${course['id']},data-id=${course['id']},data-type=${course['courseTypeKey']},data-name=${course['courseName']}">
                    <section class="thumbnail ad-course-item__wrap">
                        <img class="ad-course-item-pic lazy" th:attrappend="data-original=!${#maps.isEmpty(course['imageMap'])}? ${course['imageMap']['pcUrlMap']['large']} :''" width="100%" height="" style="max-width:100%"/>
                        <div class="ad-course-name-bx mt10">
                            <span class="c-222 fs16" th:title="${course['courseName']}" th:text="'&nbsp'+${course['courseName']}"></span>
                        </div>
                        <div class="ml5 mr5">
                            <div class="mt10 clearfix">
                                <aside class="pull-left" th:attr="id='context-status-'+${course['id']}">
                                    <span th:if="${course['contextStatus']}==1" class="label label-default">未完结</span>
                                    <span th:if="${course['contextStatus']}==2" class="label label-info">已完结</span>
                                </aside>
                                <aside class="pull-right" th:attr="id='status-'+${course['id']}">
                                    <span th:if="${course['status']}==0" class="label label-default label-default-info">未上架</span>
                                    <span th:if="${course['status']}==1" class="label label-info">已上架</span>
                                    <span th:if="${course['status']}==2" class="label label-danger">已下架</span>
                                </aside>
                            </div>
                            <div class="mt10 clearfix">
                                <aside class="pull-left" data-toggle="tooltip" data-placement="top" th:attr="data-original-title=${selaSwitch}==3?'原价/售价/会员价(元)':'原价/售价(元)'"><span class="fs12" th:text="${selaSwitch}==3?${course['orPrice']}+'/'+${course['realPrice']}+'/'+${course['memberPrice']}:${course['orPrice']}+'/'+${course['realPrice']}">价格</span></aside>
                                <aside class="pull-right" data-toggle="tooltip" data-placement="top" data-original-title="类型">
                                    <span class="fs12" th:if="${course['courseTypeKey']}=='COLUMNS'">专栏</span>
                                    <span class="fs12" th:if="${course['courseTypeKey']}=='LIVE'">直播</span>
                                    <span class="fs12" th:if="${course['courseTypeKey']}=='VIDEO'">视频</span>
                                </aside>
                            </div>
                            <div class="mt10 clearfix">
                                <aside class="pull-left" th:attr="id='context-status-'+${course['id']}" data-toggle="tooltip" data-placement="top" data-original-title="数据来源">
                                    <span th:if="${dataKey}==${course['shopTenant']} or ${course['shopTenant'] == null }">自创建</span>
                                    <span th:if="${dataKey}!=${course['shopTenant']} and ${course['shopTenant'] != null } ">平台分享</span>
                                </aside>
                                <aside class="pull-left m-l-sm" data-toggle="tooltip" data-placement="top" data-original-title="学习限制模式">
                                    <span class="fs12" th:if="${course['studyLimit']}==0">未设置</span>
                                    <span class="fs12" th:if="${course['studyLimit']}==1">无限制</span>
                                    <span class="fs12" th:if="${course['studyLimit']}==2">顺序学习</span>
                                    <span class="fs12" th:if="${course['studyLimit']}==3">随堂练习</span>
                                </aside>
                                <aside class="pull-right" data-toggle="tooltip" data-placement="top" data-original-title="剩余库存数">
                                    <span th:text="${course['buyNum']}==0?'不限':${course['buyNum']} - ${course['courseProfile']['buyCount']}"></span>
                                </aside>
                            </div>
                            <div class="mt10 clearfix">
                                <aside class="pull-left">
                                    <input type="checkbox" class="i-checks" th:value="${course['id']}">
                                    <span data-toggle="tooltip" data-placement="top" data-original-title="课程ID" th:text="${course['id']}"></span>
                                </aside>
                                <aside class="pull-right" data-toggle="tooltip" data-placement="top" data-original-title="创建人">
                                    <span th:text="!${#maps.isEmpty(course['createUser'])}?${course['createUser']['ralName']}:'—'"></span>
                                </aside>
                            </div>
                            <div class="mt10 clearfix">
                                <aside class="pull-right">
                                    <a th:href="@{/admin/course/cou/smallData?id={id}(id=${course['id']})}" class="c-master fs16 ml5" data-toggle="tooltip" data-placement="top" data-original-title="课程数据"><i class="fa fa-area-chart"></i></a>
                                    <a th:href="@{/admin/course/cou/initUpdate?id={id}(id=${course['id']})}" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="top" data-original-title="编辑课程"><i class="fa fa-edit"></i></a>
                                    <a th:href="@{/admin/course/catalog/initCourseCatalog?courseId={courseId}(courseId=${course['id']})}" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="top" data-original-title="排课目录"><i class="fa fa-list"></i></a>
                                    <a href="javascript:void(0);" class="c-master fs14 ml5 share-to-user" data-toggle="tooltip" data-placement="top" data-original-title="分享" th:attrappend="data-id=${course['id']}"><i class="fa fa-share"></i></a>
                                    <a th:if="${course['status']}==0 or ${course['status']}==2" th:attr="data-id=${course['id']},id='status-action-'+${course['id']}" href="javascript:void(0);" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="top" data-original-title="上架"><i class="fa fa-arrow-up"></i></a>
                                    <a th:if="${course['status']}==1" th:attr="data-id=${course['id']},id='status-action-'+${course['id']}" href="javascript:void(0);" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="top" data-original-title="下架"><i class="fa fa-arrow-down"></i></a>
                                    <span class="dropdown ml5">
                                        <a href="javascript:void(0);" data-toggle="dropdown"
                                           class="c-master fs16 dropdown-toggle"
                                           aria-expanded="false"
                                           title="更多操作">
                                            <i class="fa fa-ellipsis-h"></i>
                                        </a>
                                        <ul class="dropdown-menu">
                                            <li><a href="javascript:void(0);" th:attr="data-id=${course['id']},data-type=${course['courseTypeKey']},data-name=${course['courseName']}" class="courseAttrShow"><i class="fa fa-eye"></i> 课程属性</a></li>
                                            <li>
                                                <a href="javascript:void(0);" class="openShareCourseBtn" th:attrappend="data-id=${course['id']},data-allow=${course['allow']}" th:if="${course['allow']}==1 or ${course['allow']}==0"  ><i class="fa fa-code-fork"></i> 开启分销推广</a>
                                                <a href="javascript:void(0);" class="openShareCourseBtn" th:attrappend="data-id=${course['id']},data-allow=${course['allow']}" th:if="${course['allow']}==2"><i class="fa fa-code-fork"></i> 关闭分销推广</a>
                                            </li>
                                            <li><a th:if="${course['contextStatus']}==1" th:attr="data-id=${course['id']},id='context-status-action-'+${course['id']}" href="javascript:void(0);" class="c-master fa-gavel-btn"><i class="fa fa-gavel"></i> 完结此课</a></li>
                                            <li><a href="javascript:void(0);" th:attr="data-id=${course['id']}" class="c-master fa-trash-remove-bt"><i class="fa fa-trash"></i> 删除此课</a></li>
                                            <li><a href="javascript:void(0);" th:attrprepend="data-id=${course['id']}" id="copy-course" class="copy-course-btn"><i class="fa fa-clipboard"></i> 复制此课</a></li>
<!--                                            <li><a href="javascript:void(0);" class="share-course-btn" th:attr="data-id=${course['id']}"><i class="fa fa-location-arrow"></i> 共享此课</a></li>-->
                                        </ul>
                                    </span>
                                </aside>
                            </div>
                        </div>
                    </section>
            </div>
            </div>
        </div>
        <!-- 分页，开始 -->
        <div data-th-replace="layout/adminPage"></div>
        <!-- 分页，结束 -->
    </div>
</html>